import { RouteRecordRaw, RouterView } from 'vue-router'

const routes: RouteRecordRaw = {
  path: '/product',
  name: 'product',
  component: RouterView,
  meta: { title: '商品', requiresAuth: true },
  children: [
    {
      path: 'list',
      name: 'product_list',
      component: () => import('@/views/product/list.vue'),
      meta: { title: '商品列表' }
    },
    {
      path: 'add_product',
      name: 'add_product',
      component: () => import('@/views/product/addProduct.vue'),
      meta: { title: '添加商品' }
    },
    {
      path: 'edit_product/:id',
      name: 'edit_product',
      component: () => import('@/views/product/addProduct.vue'),
      meta: { title: '修改商品' }
    },
    {
      path: 'classify',
      name: 'product_classify',
      component: () => import('@/views/product/classify.vue'),
      meta: { title: '商品分类' }
    },
    {
      path: 'attr',
      name: 'product_attr',
      component: () => import('@/views/product/attr.vue'),
      meta: { title: '商品规格' }
    },
    {
      path: 'reply',
      name: 'product_reply',
      component: () => import('@/views/product/reply.vue'),
      meta: { title: '商品评论' }
    }
  ]
}

export default routes